document._NQMgr = {
       loadOrdersInfo: function (){
              alert(1);
              var retOrders = new Array();
              var orders = this.getOrderItems();
              for (var i = orders.length - 1; i >= 0; i--) {
                     var item = orders[i];
                     var price = this.getPrice(item);
                     var title = this.getTitle(item);
                     var photoUrl = this.getPhotoUrl(item);
                     var item = new Object();
                     item.price = price;
                     item.title = title;
                     item.photourl = photoUrl;
                     retOrders.push(item);
              }

              var pdIds = this.getGoodsIds();
              if (pdIds && pdIds.length) {
                     for (var i = pdIds.length - 1; i >= 0; i--) {
                            var goodsId = pdIds[i];
                            if (i < retOrders.length) {
                                   retOrders[i].goodsid = goodsId;
                            }
                     }       
              }
              if (window.naquanObj != null && window.naquanObj.getData != null) {
                     window.naquanObj.setGoodsInfo(JSON.stringify(retOrders));
              }
              return JSON.stringify(retOrders);
       },

       getOrderItems:function(){
              return document.getElementsByClassName("order-itemInfo mui-flex");
       },

       getPrice: function(item){
              var prices = item.getElementsByClassName('price');
              var text = prices[prices.length -1];
              return text.innerText.replace(/[^0-9|.]/ig, '')          
       },

       getTitle: function(item){
              var titles = item.getElementsByClassName('title');
              var str;
              for (var i = 0; i < titles.length; i++) { 
                   if (titles[i].className + '' == 'title') {
                       str = titles[i]
                       break;
                   }
              }
              return str.innerText;
       },

       getPhotoUrl : function(item){
              return item.getElementsByClassName("img")[0].getAttribute("style").split("//")[1].substr(
                     0, item.getElementsByClassName("img")[0].getAttribute("style").split("//")[1].length - 2);
       },

       getGoodsIds : function(){
              var ret = this.getGoodsIdByItemId();
              if (ret != null) {
                     return ret;
              }
              return this.getGoodsIdsByParam();
       },

       getGoodsIdsByParam: function(){
              var ret = new Array();
              var buyParam = this.getQueryString("buyParam");
              if (buyParam != null) {
                     var buyStrs = buyParam.split(",");
                     for (var i = buyStrs.length - 1; i >= 0; i--) {
                            var strItem = buyStrs[i];
                            var strs = strItem.split("_");
                            var goodsId = strs[0];
                            ret.push(goodsId);
                     }
              }else{
                     return null;
              }
              return ret;
       },

       getGoodsIdByItemId : function(){
              var ret = new Array();
              var goodid = this.getQueryString("itemId");
              if (goodid != null) {
                     ret.push(goodid);
                     return ret;
              }
              return null;
       },

       getQueryString : function(name){
              var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
              var r = window.location.search.substr(1).match(reg);
              if(r!=null)return  unescape(r[2]); return null;
       }
};

alert(2);
document._NQMgr.loadOrdersInfo();